Filter hook 'rest_{$this->post_type}_collection_params'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 2995

Description

Filters collection parameters for the posts controller. The dynamic part of the filter `$this->post_type` refers to the post type slug for the controller. This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Query parameter. Use the `rest_{$this->post_type}_query` filter to set WP_Query parameters.

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2995

Parameters

Type Name Description
array $query_params JSON Schema-formatted collection parameters.
WP_Post_Type $post_type Post type object.

PHP Doc

/**
		 * Filters collection parameters for the posts controller.
		 *
		 * The dynamic part of the filter `$this->post_type` refers to the post
		 * type slug for the controller.
		 *
		 * This filter registers the collection parameter, but does not map the
		 * collection parameter to an internal WP_Query parameter. Use the
		 * `rest_{$this->post_type}_query` filter to set WP_Query parameters.
		 *
		 * @since 4.7.0
		 *
		 * @param array        $query_params JSON Schema-formatted collection parameters.
		 * @param WP_Post_Type $post_type    Post type object.
		 */